package com.etoak.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;

import java.time.LocalDateTime;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 
 * </p>
 *
 * @author et2107
 * @since 2024-01-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_position")
public class Position implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id")
    private String id;

    private String uid;

    private double lon;

    private double lat;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @Override
    public boolean equals(Object obj){
        if ( obj instanceof Position){
            Position b = (Position)obj;
            if (this.id == b.id && this.lat==b.lat && this.createTime == b.createTime){
                return true;
            }
        }
        return false;
    }


}
